<%--
  User: wyz
  Date: 2024/7/22
  Time: 11:01
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>联系人</title>
</head>
<body>
<h3>联系人列表<a href="/main.jsp">返回主页</a> </h3>

<table border="1">
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>电话号码</th>
        <th>电子邮件</th>
        <th>职位</th>
        <th>部门</th>
        <th>账号</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${contacts}" var="contact">
        <tr>
            <td>${contact.id}</td>
            <td>${contact.name}</td>
            <td>${contact.phone}</td>
            <td>${contact.email}</td>
            <td>${contact.position}</td>
            <td>${contact.department}</td>
            <td>${contact.account}</td>
            <td>
                <!-- 修改按钮 -->
                <a href="/contact/edit.do?id=${contact.id}" class="btn">修改</a>
                <!-- 删除按钮 -->
                <a href="/contact/del.do?id=${contact.id}" class="btn" onclick="return confirm('确定要删除吗？');">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>